//package org.ricks.bootstrap.conf;
//
//import com.zaxxer.hikari.HikariConfig;
//import com.zaxxer.hikari.HikariDataSource;
//import org.ricks.common.conf.RicksPropertiesLoader;
//import org.ricks.ioc.anno.Bean;
//import org.ricks.ioc.anno.Configuration;
////import org.ricks.orm.ConnectionSourceHelper;
////import org.ricks.orm.DataAccessor;
////import org.ricks.orm.MysqlDataAccessor;
//
//@Configuration
//public class BootConf {
//
//    @Bean
//    public DataAccessor initDataSource() {
//        HikariConfig hikariConfig = new HikariConfig();
//        hikariConfig.setJdbcUrl(RicksPropertiesLoader.get("jdbc.url"));//mysql
//        hikariConfig.setDriverClassName(RicksPropertiesLoader.get("jdbc.driverClassName"));
//        hikariConfig.setUsername(RicksPropertiesLoader.get("jdbc.username"));
//        hikariConfig.setPassword(RicksPropertiesLoader.get("jdbc.password"));
//        hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
//        hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
//        hikariConfig.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
////            hikariConfig.setConnectionTestQuery("SELECT 1");
//        hikariConfig.setIdleTimeout(5000);
//        hikariConfig.setMaximumPoolSize(20);
//        hikariConfig.setKeepaliveTime(5000);
//        hikariConfig.setValidationTimeout(3000);
//        hikariConfig.setMaxLifetime(1000);
//        HikariDataSource masterDataSource = new HikariDataSource(hikariConfig);
//        return new MysqlDataAccessor(ConnectionSourceHelper.getSingle(masterDataSource));
//    }
//}
